package atguigu;

import com.atguigu.bean.Dog;
import com.atguigu.config.MainConfigOfLifeCycle;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author gcq
 * @Create 2020-09-22
 */
public class IOCTest_Lifecycle {


    @Test
    public void test01() {
        // 创建容器
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigOfLifeCycle.class);
        System.out.println("容器创建完成");
     /*   Car car = (Car) applicationContext.getBean("car");
        System.out.println(car);*/
        Dog dog = (Dog) applicationContext.getBean("dog");
        System.out.println(dog);
        applicationContext.close();
        
    }
}